#ifndef SCENARIOELEMENT_H_
#define SCENARIOELEMENT_H_

#include "../common/utils/Logger.h"

#include "Event.h"
#include "Surface.h"
#include "Widget.h"
#include "../common/DTOScenarioElement.h"

class ScenarioElement: public Widget {
public:

	ScenarioElement(int xPos, int yPos, Widget* parent,
			std::string elementImagePath);

	ScenarioElement(DTOScenarioElement* dto);

	virtual void handleEvent(Event event);

	virtual void resolve();

	virtual void showOn(SDL_Surface* surface);

	void setParent(Widget* parent);

	void setMouseAttach();
	void unsetMouseAttach();
	bool getMouseAttach() const;
	bool isOver(Rectangle rectangle) const;

	int getXPos() const;
	int getYPos() const;
	std::string getName() const;
	std::string getPath() const;

	DTOScenarioElement* getDTO();

	virtual ~ScenarioElement();

protected:

	std::string path;
	SDL_Surface* element;

	ScenarioElement();

	void setPath(std::string path);

private:

	std::stringstream logging;

	int nextX, nextY;
	bool mouseAttached;

};

#endif /* SCENARIOELEMENT_H_ */
